package com.example.demo.advice;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ModelAttribute;


@ControllerAdvice
public class GlobalDataAdvice {

    @ModelAttribute
    public void addCommonAttributes(Model model) {
        model.addAttribute("name", "刘伟");
    }

}
